package com.chuantou.yuba.api.to;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

public class FishingShopDetailTO implements Parcelable {

	@SerializedName("detail")
	private FishingShopTO shop;

	@SerializedName("fav")
	private int fav;

	public FishingShopDetailTO(Parcel source) {
		this.shop = source.readParcelable(FishingShopTO.class.getClassLoader());
		this.fav = source.readInt();
	}

	public boolean isFaved() {
		return fav == 1;
	}

	public void setFaved(boolean faved) {
		fav = faved ? 1 : 0;
	}

	public FishingShopDetailTO() {

	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeParcelable(shop, flags);
		dest.writeInt(fav);
	}

	public static final Creator<FishingShopDetailTO> CREATOR = new Creator<FishingShopDetailTO>() {

		@Override
		public FishingShopDetailTO[] newArray(int size) {
			return new FishingShopDetailTO[size];
		}

		@Override
		public FishingShopDetailTO createFromParcel(Parcel source) {
			return new FishingShopDetailTO(source);
		}
	};

	public FishingShopTO getShop() {
		return shop;
	}

	public void setShop(FishingShopTO shop) {
		this.shop = shop;
	}

	public int getFav() {
		return fav;
	}

	public void setFav(int fav) {
		this.fav = fav;
	}

}
